/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.cotelasa.scp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Esparza
 */
@Entity
@Table(name = "producto_estilo", catalog = "bdcotelasa", schema = "cotelasa")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ProductoEstilo.findAll", query = "SELECT p FROM ProductoEstilo p"),
    @NamedQuery(name = "ProductoEstilo.findById", query = "SELECT p FROM ProductoEstilo p WHERE p.id = :id")})
public class ProductoEstilo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @JoinColumn(name = "id_talla", referencedColumnName = "id")
    @ManyToOne(fetch=FetchType.LAZY)
    private Talla idTalla;
    @JoinColumn(name = "id_color", referencedColumnName = "id")
    @ManyToOne(fetch=FetchType.LAZY)
    private Color idColor;

    public ProductoEstilo() {
    }

    public ProductoEstilo(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Talla getIdTalla() {
        return idTalla;
    }

    public void setIdTalla(Talla idTalla) {
        this.idTalla = idTalla;
    }

    public Color getIdColor() {
        return idColor;
    }

    public void setIdColor(Color idColor) {
        this.idColor = idColor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ProductoEstilo)) {
            return false;
        }
        ProductoEstilo other = (ProductoEstilo) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.com.cotelasa.scp.entidad.ProductoEstilo[ id=" + id + " ]";
    }
    
}
